#  try 试一下  尝试
#  except  exception  异常
#  package   包

#  a
#  NameError : name 'a' is not defind

# dict = {}, dict['a']
# KeyError : 'a'

# 10/0

# list1
# IndexError: list index out of range

#  Exception 是所有异常的父类

try:
    list1 = [1,2,3]
    list1[3]
except Exception as e: # except 异常名(Exception) as 返回值(异常的详细信息)
    print(e)

print('上方代码异常')






